<template>
  <el-dialog
    v-model="model"
    :close-on-click-modal="false"
    :title="title"
    width="415px"
    @close="okFn"
  >
    <div class="content">
      {{ content }}
    </div>
    <template #footer>
      <span class="dialog-footer">
        <!-- <el-button @click="model = false">取消</el-button> -->
        <el-button type="primary" @click="okFn">
          确认
        </el-button>
      </span>
    </template>
  </el-dialog>
</template>

<script>
import { ref } from 'vue'

export default {
  emits: ['refresh-list'],
  setup(props, { emit }) {
    const model = ref(false)
    const title = ref('提示')
    const content = ref('')
    
    function show(val) {
      model.value = true
      content.value = val
    }

    function okFn() {
      model.value = false
      emit('refresh-list')
    }
    return {
      model,
      show,
      title,
      content,
      okFn
    }
  }
}

</script>

<style scoped lang="scss">
.content {
  padding: 14px 0 20px 10px;
  font-size: 16px;
  font-weight: 500;
  color: #333;
}
</style>